GBML manual / Audio

sound_pan

Sets the panning (-1 hard left .. 0 center .. 1 hard right) of s’s own currently-playing instance - the same "still remembers one" instance sound_stop/sound_playing already look up by s alone.

Syntax

sound_pan(s, panning)

Arguments

NameType
ssound
panningreal

Returns

Nothing.

Description

Sets the panning (-1 hard left .. 0 center .. 1 hard right) of s's own currently-playing instance - the same "still remembers one" instance sound_stop/sound_playing already look up by s alone. A no-op if s is not currently tracked as playing (already finished, evicted for a newer sound, or never played).

There is no way to set panning at play time through sound_play itself - call sound_pan right after it, in the same event, for the same effect: both calls resolve before anything is actually heard, so there is no audible gap.

Example

sound_play(snd_doc_beep, 1);
sound_pan(snd_doc_beep, -0.6);

Plays the beep and immediately pans it toward the left speaker - the usual shape for a sound whose source sits to one side of the camera, computed once per play from wherever that source actually is.

On the GBA

A no-op if s is not currently tracked as playing (already finished, evicted for a newer sound, or never played - sound_playing(s) answers which). There is no way to set panning at play time through sound_play itself; call sound_pan right after sound_play in the same event for the same effect - both resolve before anything is heard.

See also: sound_speedsound_playsound_stop